package design_pattern.decorator.test2;

/**
 * Created by WeiDingKuo on 2017/10/25 14:47
 * <p>
 * 如果被装饰者只有一个类，则Component接口可以省略
 */
public class Test {
    public static void main(String[] args) {
        System.out.println("==== 组合1 ====");
        new Decorator2(new Decorator1(new ComponentImpl())).dosomething();
        System.out.println();
        System.out.println("==== 组合2 ====");
        new Decorator1(new Decorator2(new ComponentImpl())).dosomething();
    }
}
